const fs = require("fs");
const path = require("path");

// 获取当前目录
const currentDir = path.basename(__dirname);
const routerFiles = fs.readdirSync(currentDir);
const routers = {};
routerFiles.forEach(file => {
    const filePath = path.join(__dirname, file);

    // Exclude the current file
    if (file !== 'index.js' && fs.statSync(filePath).isFile()) {
        const routerName = path.basename(file, '.js');
        routers[routerName] = require(`./${file}`);
    }
});
module.exports= routers;
